package com.ecoolex.ying.space.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   用户商品附件下载任务<br>
 *<br>
 * 数据表： user_goods_attachment_download_task
 *
 */
@Description({"用户商品附件下载任务"})
public class UserGoodsAttachmentDownloadTask implements Serializable {
    /**
     *
     *   id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Id
     */
    @Description({"id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer id;

    /**
     *
     *   用户Id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UserId
     */
    @Description({"用户Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer userId;

    /**
     *
     *   任务名称    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Name
     */
    @Description({"任务名称", "不能为空", "数据长度: 100"})
    @NonNull
    private String name;

    /**
     *
     *   附件类型; 商品图片; 商品模型; 产品图片附件    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Type
     */
    @Description({"附件类型; 商品图片; 商品模型; 产品图片附件", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer type;

    /**
     *
     *   数据md5值    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DataMD5
     */
    @Description({"数据md5值", "不能为空", "数据长度: 190"})
    @NonNull
    private String dataMD5;

    /**
     *
     *   下载资源Id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DownloadStorageId
     */
    @Description({"下载资源Id", "数据长度: 190"})
    private String downloadStorageId;

    /**
     *
     *   状态; 待处理; 已处理;    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Status
     */
    @Description({"状态; 待处理; 已处理;", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer status;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    /**
     *
     *   内容    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Data
     */
    @Description({"内容", "不能为空", "数据长度: 65535"})
    @NonNull
    private String data;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置参数<br><br>
     *
     *   id<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取参数<br><br>
     *
     *   用户Id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UserId
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置参数<br><br>
     *
     *   用户Id<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UserId
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取参数<br><br>
     *
     *   任务名称    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置参数<br><br>
     *
     *   任务名称<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Name
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   附件类型; 商品图片; 商品模型; 产品图片附件    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Type
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置参数<br><br>
     *
     *   附件类型; 商品图片; 商品模型; 产品图片附件<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Type
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 获取参数<br><br>
     *
     *   数据md5值    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DataMD5
     */
    public String getDataMD5() {
        return dataMD5;
    }

    /**
     * 设置参数<br><br>
     *
     *   数据md5值<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DataMD5
     */
    public void setDataMD5(String dataMD5) {
        this.dataMD5 = dataMD5 == null ? null : dataMD5.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   下载资源Id    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DownloadStorageId
     */
    public String getDownloadStorageId() {
        return downloadStorageId;
    }

    /**
     * 设置参数<br><br>
     *
     *   下载资源Id<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.DownloadStorageId
     */
    public void setDownloadStorageId(String downloadStorageId) {
        this.downloadStorageId = downloadStorageId == null ? null : downloadStorageId.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   状态; 待处理; 已处理;    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置参数<br><br>
     *
     *   状态; 待处理; 已处理;<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   内容    <br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Data
     */
    public String getData() {
        return data;
    }

    /**
     * 设置参数<br><br>
     *
     *   内容<br>
     *<br>
     * 字段名： user_goods_attachment_download_task.Data
     */
    public void setData(String data) {
        this.data = data == null ? null : data.trim();
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        id("Id", "id", "INTEGER", false),
        userId("UserId", "userId", "INTEGER", false),
        name("Name", "name", "VARCHAR", true),
        type("Type", "type", "INTEGER", true),
        dataMD5("DataMD5", "dataMD5", "VARCHAR", false),
        downloadStorageId("DownloadStorageId", "downloadStorageId", "VARCHAR", false),
        status("Status", "status", "INTEGER", true),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false),
        data("Data", "data", "LONGVARCHAR", true);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}